import java.util.*;
import java.io.*;

public class Main {
    /**
     * 小乐乐改数字
     * https://www.nowcoder.com/practice/fcd30aac9c4f4028b23919a0c649824d?tpId=290&tqId=39833&ru=/exam/oj
     */
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        char[] s = Integer.toString(in.nextInt()).toCharArray();

        int len = s.length;
        for(int i = 0;i < len;i++){
            if(s[i] % 2 == 0) s[i] = '0';
            else s[i] = '1';
        }
        int i = 0;
        while(i < len - 1 && s[i] == '0') i++;

        for(;i < len;i++) System.out.print(s[i]);
    }

    /**
     * 十字爆破
     * https://ac.nowcoder.com/acm/problem/205836
     */
    //输出类
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    //输入类
    static Read in = new Read();

    public static void main2(String[] args)throws IOException {
        int n = in.nextInt(),m = in.nextInt();
        long[][] nums = new long[n][m];
        long[] row = new long[n];
        long[] col = new long[m];

        //预处理
        for(int i =0;i < n;i++){
            for(int j = 0;j < m;j++){
                nums[i][j] = in.nextLong();
                row[i] += nums[i][j];
                col[j] += nums[i][j];
            }
        }

        for(int i = 0;i < n;i++){
            for(int j = 0;j < m;j++){
                long tem = row[i] + col[j] - nums[i][j];
                out.print(tem + " ");
            }
            out.println();
        }
        out.close();
    }

    /**
     * 比那名居的桃子
     * https://ac.nowcoder.com/acm/problem/224679
     */
    //解法一：滑动窗口
    public static void main3_1(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(),k = in.nextInt();

        long[] a = new long[n + 1];
        long[] b = new long[n + 1];

        for(int i = 1;i <= n;i++) a[i] = in.nextLong();
        for(int j = 1;j <= n;j++) b[j] = in.nextLong();

        //滑动窗口
        int left = 1,right = 1;
        long h_sum = 0,s_sum = 0,h_max = 0,s_min = 0,begin = 1;
        while(right <= n){
            //进窗口
            h_sum += a[right];
            s_sum += b[right];

            //出窗口
            if(right - left + 1 > k){
                h_sum -= a[left];
                s_sum -= b[left];
                left++;
            }

            //判断
            if(right - left + 1 == k){
                if(h_max < h_sum){
                    h_max = h_sum;
                    s_min = s_sum;
                    begin = left;
                }
                else if(h_max == h_sum && s_min > s_sum){
                    s_min = s_sum;
                    begin = left;
                }
            }
            right++;
        }
        System.out.println(begin);
    }
   //解法二：前缀和
    public static void main3_2(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(),k = in.nextInt();

        long[] a = new long[n + 1];
        long[] b = new long[n + 1];

        for(int i = 1;i <= n;i++) a[i] = in.nextLong() + a[i - 1];
        for(int j = 1;j <= n;j++) b[j] = in.nextLong() + b[j - 1];

        //滑动窗口
        int i = k,begin = 1;
        long hMax = 0,sMin = 0,hSum = 0,sSum = 0;
        while(i <=n){
            hSum = a[i] - a[i - k];
            sSum = b[i] - b[i - k];

            if(hMax < hSum){
                hMax = hSum;
                sMin = sSum;
                begin = i - k + 1;
            }
            else if(hMax == hSum && sMin > sSum){
                sMin = sSum;
                begin = i - k + 1;
            }
            i++;
        }

        System.out.println(begin);
    }

}
class Read{
    //读取子串类
    StringTokenizer st = new StringTokenizer("");//按照“”分割
    //读取类
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    //读取子串
    String next() throws IOException{
        //判断当前行是否还有子串
        while(!st.hasMoreTokens()){
            //没有就出现读取一行数据
            st = new StringTokenizer(br.readLine());
        }

        return st.nextToken();
    }

    //返回一行
    String nextLine() throws IOException{
        return br.readLine();
    }

    Integer nextInt() throws IOException{
        return Integer.parseInt(next());
    }
    Long nextLong() throws IOException{
        return Long.parseLong(next());
    }
    Double nextDouble() throws IOException{
        return Double.parseDouble(next());
    }
}

class Solution{
    public static void main(String[] args)throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        //1.预处理
        int n = br.read() -'0',k = br.read() - '0';

        long[] a = new long[n + 1];
        long[] b = new long[n + 1];

        for(int i = 1;i <= n;i++){
            a[i] = br.read() - '0';

        }
        for(int i = 1;i <= n;i++){
            b[i] = br.read() - '0';
        }

        //2.滑动窗口
        int left = 1,right = 1;long s1 = 0,s2 = 0,e1 = 0,e2 = 0,target = 1;

        while(right <= n){
            //1.进入窗口
            s1 += a[right];
            s2 += b[right];

            //2.判断
            if(right - left + 1 > k){
                s1 -= a[left];
                s2 -= b[left];
                left++;
            }

            //3.合法区间，更新结果
            if(s1 > e1){
                e1 = s1;
                target = left;
            }else if(s2 > e2){
                e2 = s2;
                target = left;
            }

            right++;
        }

        //输出最终结果
        System.out.println(target);
    }
}